package java_1_10.interface_test;

class X{
    int num;
}
public class Y implements Cloneable{
    X x=new X();

    @Override
    protected Y clone() throws CloneNotSupportedException {
        return (Y)super.clone();
    }

    public static void main(String[] args) throws CloneNotSupportedException {
        Y y1=new Y();
        Y y2=y1.clone();
        System.out.println(y1==y2);
        System.out.println(y2.x.num);
        y1.x.num=100;
        System.out.println(y2.x.num);
    }
}
